package cn.nucpyh.soft;

public class SeqListFun {
    public static void main(String[] args) {
        String str = new String("123321");

        //1.
//        StringBuilder sb = new StringBuilder();
//        sb.append(str);
//        sb.reverse();
//        System.out.println(sb);//打印
        //2. = 1.
        String results = new StringBuilder().append(str).reverse().toString();
        System.out.println(results);//打印

        //比较翻转前后的值是否一样
        if(str.equals(results)){
            System.out.println("该字符串为对称字符串!");
        }else{
            System.out.println("该字符串不是对称字符串!");
        }


        //总结:StringBuilder的使用场景
        //1.字符串的拼接
        //2.字符串的翻转
    }
}
